package com.brother.template.web;

import com.brother.template.quart.TodayService;
import com.brother.template.util.RMap;
import com.brother.template.util.TimeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.Map;

/**
 * @Auther: keepx
 * @Date: 2018/10/18 22:32
 * @Description:
 */
@RestController
public class IndexController {

    @Autowired
    private TodayService todayService;

    @RequestMapping("/run")
    public void run(HttpServletResponse response, HttpServletRequest request) {
        String endTime = request.getParameter("EndTime");
        todayService.common(TimeUtil.getDateOfString(endTime));
    }

    @RequestMapping("/runTody")
    public void runTody(HttpServletResponse response, HttpServletRequest request) {
        todayService.common(new Date());
    }
}
